

// const REQUEST_URL = "https://tongkunpage.unionalltech.com";
// 通用请求地址
const REQUEST_URL = "/api/wechat/common_support_api";
// 获取token地址
const REQUEST_TOKEN_URL = "/api/wechat/authorize/program/login"
// 发送验证码
const REQUEST_SEND_CODE = "/api/wechat/sendValidCode"


function REQUEST_HEADERS(){
    return {EosSoftToken : getUserInfoToken()}
}


function responseHandler(response,status,xhr){
    if(response.code == 200){
        return response ;
    }
    if(response.code == 5003 || response.code == 5008){
        setLoginStatus(false);
        location.replace(INDEX_PAGE)
        return response;
    }
    layer.open({
        title:"请求异常",
        content :"[错误码:"+response.code+"]"+response.message
    })
    return response ;
    
}


function getUrlParam(key){
    
    var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    const v = decodeURIComponent(r&&r.length>=3?r[2]:null);
    if (r != null) return v; return null;
}